
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" scope="page"/>
<html>
<head>
    <title>Insert title here</title>
    <link rel="stylesheet" href="${ctx}/css/templatemo_style.css" /> <!-- 页面整体布局样式定义 -->
    <link rel="stylesheet" href="${ctx}/css/ddsmoothmenu.css" /> <!-- 菜单样式定义 -->
    <script type="text/javascript" src="${ctx}/js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript">
        var ctx = "${pageContext.request.contextPath}";
        function showUserName(){
            var name = "${user.userName}";

            if(name != ""){
                $("#login").html(name);
                $("#exitP").show();
                $("#login").attr("href", ctx + "/user?flag=finduser&username=${user.userName}");
            }else{
                $("#login").html("登录");
                $("#exitP").hide();
                $("#login").attr("href", ctx + "/user?flag=login");
            }
        }

        function ajax() {
            if ("${user.userName}"!=""){
                $.get(
                    "${ctx}/order?flag=data",
                    {"userId":"${user.userName}"},
                    function(data){
                        alert(data);
                    },
                    "text"
                );
            }
            else {
                alert("请登录");
            }
        }
        $(document).ready(function () {
            $("#xyy").click(function () {
                if(${po.pageNo}!=${po.pages})
                {
                    $("#xyy").attr("href","${ctx}/order?pageNo="+(${po.pageNo}+1)+"&pageSize="+$("#ps").val());
                }
            })

            $("#syy").click(function () {
                if(${po.pageNo}-1!=0){
                    $("#syy").attr("href","${ctx}/order?pageNo="+(${po.pageNo}-1)+"&pageSize="+$("#ps").val());
                }
            })

            $("#ps").change(function ( ) {
                $("#xyy").attr("href","${ctx}/order?pageNo=1&pageSize="+$("#ps").val());
            })
        });
    </script>
</head>

<body>
<div id="templatemo_body_wrapper">
    <div id="templatemo_wrapper">


        <!-- header -->
        <div id="templatemo_header">
            <div id="site_title"><h1><a href="/home">穿美在线鞋城</a></h1></div>
            <div id="header_right">
                <p>
                    <a href="${ctx}/user?flag=login" id="login">登录</a>&nbsp;
                    <span id="exitP" style="display: none"><a href="${ctx}/user?flag=logout" id="exit">注销</a></span>
                </p>
            </div>
            <div class="cleaner"></div>
        </div>
        <!-- END of templatemo_header -->


        <!-- menu -->
        <div id="templatemo_menubar">
            <div id="top_nav" class="ddsmoothmenu">
                <ul>
                    <li><a href="${ctx}/home">首页</a></li>
                    <li><a href="${ctx}/product">产品</a></li>
                    <li><a href="${ctx}/shopcart?&userId=${sessionScope.user.userId}">我的购物车</a></li>
                    <li><a href="${ctx}/order" class="selected">我的订单</a></li>
                </ul>
                <br style="clear: left" />
            </div>
            <!-- end of ddsmoothmenu -->
        </div>
        <!-- END of templatemo_menubar -->

        <div id="templatemo_main">
            <div id="content" class="float_l" style="height:600px;margin-left:120px">
                <h2>订单列表</h2>
                <table style="border:1px solid #CCCCCC;" width="100%">
                    <tr>
                        <td>
                            订单编号
                        </td>
                        <td width="300px;" style="padding: 0px 20px;">
                            订单日期
                        </td>
                        <td>金额</td>
                    </tr>

                    <c:forEach items="${po.objs}"  var="op">
                        <tr>
                            <td>
                                <a href="${ctx}/order?flag=d&orderId=${op.orderId}" class="more">${op.orderId}</a>
                            </td>
                            <td width="200px;" style="padding: 0px 20px;">
                                ${op.createTime}
                            </td>
                            <td>${op.amount}</td>
                        </tr>
                    </c:forEach>
                    <!--<tr>
                        <td>
                            <a href="${ctx}/order?flag=d&orderId=ORD8952DD72" class="more">ORD8952DD72</a>
                        </td>
                        <td width="200px;" style="padding: 0px 20px;">
                            2019-04-09
                        </td>
                        <td>￥480.0</td>
                    </tr>

                    <tr>
                        <td>
                            <a href="${ctx}/order?flag=d&orderId=OR66B602A26" class="more">OR66B602A26</a>
                        </td>
                        <td width="200px;" style="padding: 0px 20px;">
                            2019-04-11
                        </td>
                        <td>￥31680.0</td>
                    </tr>

                    <tr>
                        <td>
                            <a href="${ctx}/order?flag=d&orderId=OR70F337882" class="more">OR70F337882</a>
                        </td>
                        <td width="200px;" style="padding: 0px 20px;">
                            2019-04-11
                        </td>
                        <td>￥0.0</td>
                    </tr>-->

                </table>

                <br>

                <div class="product_box_fy">
                  <p>
                        <a href="${ctx}/order?pageNo=1&pageSize=4" id="sy">首页</a> |
                        <a href="javascript:void(0)" id="syy">上一页</a> |

                        <a href="javascript:void(0)">每页&nbsp;<input type="text" id="ps" name="ps" values="${pagesize}" maxlength="2" style="width: 18px; height: 12px; text-align: center;">条数据&nbsp; </a> |
                        <a href="javascript:void(0)">第${po.pageNo}页/共${po.pages}页</a> |

                        <a href="javascript:void(0)" id="xyy">下一页</a> |
                        <a href="${ctx}/order?pageNo=${po.pages}">尾页</a>
                    </p>
                </div>
            </div>

            <div class="cleaner"></div>
        </div> <!-- END of templatemo_main -->


        <!-- footer -->
        <div id="templatemo_footer">
            <p>
                <a href="${ctx}/home">首页</a> | <a href="${ctx}/product">产品</a> | <a href="${ctx}/shopcart">我的购物车</a> | <a href="${ctx}/order">我的订单</a>
            </p>
            版权所有 (c) 2018 <a href="javascript:void(0);">金桥软件</a>
        </div>
        <!-- END of templatemo_footer -->


    </div>
    <!-- END of templatemo_wrapper -->
</div>
<!-- END of templatemo_body_wrapper -->
<script type="text/javascript">
    $(function(){
        showUserName();
    });
</script>
</body>
</html>
